/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package org.abc;

import java.util.Date;

/**
 * <p>Project: jse2303 - Date2
 * <p>Powered by webrx On 2023-07-10 09:24:11
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Date2 {
    public static void main(String[] args) {
        //当前系统的日期
        Date d1 = new Date();
        System.out.println(d1);

        //根据时间戳0L 建立日期对象
        Date d2 = new Date(0L);
        System.out.println(d2);

        //根据当前时间戳建立日期对象
        Date d3 = new Date(System.currentTimeMillis());
        System.out.printf("%tF %<tT", d3);

        System.out.println();
        long nn = d3.getTime();
        System.out.println(d3.getYear() + 1900);
        System.out.println(d3.getMonth() + 1);
        System.out.println(d3.getDate());
        System.out.println(d3.getDay());
    }
}
